package com.centit.framework.ip.businessdata.po;

import org.hibernate.validator.constraints.Length;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;


/**
 * create by scaffold 2018-06-04
 *
 * @author guo_jh
 * <p>
 * T_MESSAGE_INFO支撑平台消息数据表
 */
@Entity
@Table(name = "T_MESSAGE_INFO")
public class MessageInfo implements java.io.Serializable {
    private static final long serialVersionUID = 1L;


    /**
     * DATAID 数据ID
     */
    @Id
    @Column(name = "REC_ID")

    private String recId;

    /**
     * DATATITLE 数据标题
     */
    @Column(name = "DATATITLE")
    @Length(min = 0, max = 100, message = "字段长度不能小于{min}大于{max}")
    private String dataTitle;
    /**
     * DATACONTENT 数据主体
     */
    @Column(name = "DATACONTENT")
    private String dataContent;
    /**
     * DATATYPE 数据类型
     */
    @Column(name = "DATATYPE")
    @Length(min = 0, max = 2, message = "字段长度不能小于{min}大于{max}")
    private String dataType;
    /**
     * CREATETIME 数据推送时间
     */
    @Column(name = "CREATETIME")
    private Date createTime;
    /**
     * SYSTEMID 来源系统
     */
    @Column(name = "SYSTEMID")
    @Length(min = 0, max = 32, message = "字段长度不能小于{min}大于{max}")
    private String systemId;
    /**
     * ISVALID 数据有效性
     */
    @Column(name = "ISVALID")
    @Length(min = 0, max = 2, message = "字段长度不能小于{min}大于{max}")
    private String isValid;
    /**
     * USER_CODE 用户ID
     */
    @Column(name = "USER_CODE")
    @Length(min = 0, max = 32, message = "字段长度不能小于{min}大于{max}")
    private String userCode;
    /**
     * 跳转地址
     */
    @Column(name = "URL")
    private String url;
    /**
     * 已读未读 已读0，未读空或者1
     */
    @Column(name = "IFREAD")
    private String ifread;
    /**
     * 是否置顶 不置顶0 置顶1
     */
    @Column(name = "IFZD")
    private String ifzd;
    /**
     * 图片新闻主图片
     */
    @Column(name = "NEWFILEID")
    private String newfileid;


    // Constructors

    /**
     * default constructor
     */
    public MessageInfo() {
    }

    /**
     * minimal constructor
     */
    public MessageInfo(
            String recId
    ) {


        this.recId = recId;

    }

    /**
     * full constructor
     */
    public MessageInfo(
            String recId
            , String dataTitle, String dataContent, String dataType, Date createTime, String systemId, String isValid, String userCode,String url,String ifread,String ifzd,String newfileid) {


        this.recId = recId;

        this.dataTitle = dataTitle;
        this.dataContent = dataContent;
        this.dataType = dataType;
        this.createTime = createTime;
        this.systemId = systemId;
        this.isValid = isValid;
        this.userCode = userCode;
        this.url=url;
        this.ifread=ifread;
        this.ifzd=ifzd;
        this.newfileid=newfileid;

    }


    public String getRecId() {
        return this.recId;
    }

    public void setRecId(String recId) {
        this.recId = recId;
    }
    // Property accessors

    public String getDataTitle() {
        return this.dataTitle;
    }

    public void setDataTitle(String dataTitle) {
        this.dataTitle = dataTitle;
    }

    public String getDataContent() {
        return this.dataContent;
    }

    public void setDataContent(String dataContent) {
        this.dataContent = dataContent;
    }

    public String getDataType() {
        return this.dataType;
    }

    public void setDataType(String dataType) {
        this.dataType = dataType;
    }

    public Date getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getSystemId() {
        return this.systemId;
    }

    public void setSystemId(String systemId) {
        this.systemId = systemId;
    }

    public String getIsValid() {
        return this.isValid;
    }

    public void setIsValid(String isValid) {
        this.isValid = isValid;
    }

    public String getUserCode() {
        return userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getIfread() {
        return ifread;
    }

    public void setIfread(String ifread) {
        this.ifread = ifread;
    }

    public String getIfzd() {
        return ifzd;
    }

    public void setIfzd(String ifzd) {
        this.ifzd = ifzd;
    }

    public String getNewfileid() {
        return newfileid;
    }

    public void setNewfileid(String newfileid) {
        this.newfileid = newfileid;
    }

    public MessageInfo copy(MessageInfo other) {

        this.setRecId(other.getRecId());

        this.dataTitle = other.getDataTitle();
        this.dataContent = other.getDataContent();
        this.dataType = other.getDataType();
        this.createTime = other.getCreateTime();
        this.systemId = other.getSystemId();
        this.isValid = other.getIsValid();
        this.userCode = other.getUserCode();
        this.url=other.getUrl();
        this.ifread=other.getIfread();
        this.ifzd=other.getIfzd();
        this.newfileid=other.getNewfileid();
        return this;
    }

    public MessageInfo copyNotNullProperty(MessageInfo other) {

        if (other.getRecId() != null) {
            this.setRecId(other.getRecId());
        }

        if (other.getDataTitle() != null) {
            this.dataTitle = other.getDataTitle();
        }
        if (other.getDataContent() != null) {
            this.dataContent = other.getDataContent();
        }
        if (other.getDataType() != null) {
            this.dataType = other.getDataType();
        }
        if (other.getCreateTime() != null) {
            this.createTime = other.getCreateTime();
        }
        if (other.getSystemId() != null) {
            this.systemId = other.getSystemId();
        }
        if (other.getIsValid() != null) {
            this.isValid = other.getIsValid();
        }
        if (other.getUserCode() != null) {
            this.userCode = other.getUserCode();
        }
        if(other.getUrl()!=null){
            this.url=other.getUrl();
        }
        if(other.getIfread()!=null){
            this.ifread=other.getIfread();
        }
        if(other.getIfzd()!=null){
            this.ifzd=other.getIfzd();
        }
        if(other.getNewfileid()!=null){
            this.newfileid=other.getNewfileid();
        }
        return this;
    }

    public MessageInfo clearProperties() {

        this.dataTitle = null;
        this.dataContent = null;
        this.dataType = null;
        this.createTime = null;
        this.systemId = null;
        this.isValid = null;
        this.userCode = null;
        this.url=null;
        this.ifread=null;
        this.ifzd=null;
        this.newfileid=null;
        return this;
    }
}
